<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        //对橡解构的作用: 方便获取对象的内部属性!
        //对象解构的语法 -> {key必须等于属性:别名}
        //1.基本对象解构
        // let {name,age} = {name:'二狗子',age:18};
        // console.log(names,ages);
        //2.对象解构属性别名
        // let {name:names,age:ages} = {name:'二狗子',age:18};
        //3.对象解构嵌套
        //let {name,age,bgfs:[num,{bfname}]} ={name:'二狗子',age:18,bgfs:["111",{bfname:'刘德华'}]};
        //4.对象的剩余属性解构
        // ...在最后
        let {name,...p} = {name:'二狗子',age:18,bgfs:["111",{bfname:'刘德华'}]};
        console.log(name,p);

    </script>
</body>
</html>